{extend name="public/common"}

{block name="style"}
<title>点对点教育VIP学员_每日单词</title>
<link rel="stylesheet" href="__HOME__/css/word/detail.css">
<link rel="stylesheet" href="__HOME__/css/word/APlayer.min.css">
<style>
    .manager.after {
        display: inline-block;
        position: fixed;
        bottom: 68px;
        right: 10px;
        content: '';
        width: 12.4vw;
        height: 12.4vw;
        background: url(__HOME__/images/common/news.png) no-repeat;
        background-color: #fff;
        background-size: 100% 100%;
        opacity: 1;
        -webkit-animation: cir2 0.5s ease-in;
        animation: cir2 0.5s ease-in;
        z-index: 99;
    }
</style>
{/block}
{block name="body"}
<div class="scrollDiy" data-id="0">
    <div class="rep_main">
        <div class="title">{$article.title}</div>
        <div class="note clear">
            <span class="fls">{$article.publisher}</span>
            <span class="frs">{$article.create_time|time_format="Y-m-d"}</span>
        </div>
        {notempty name="$article.record1"}
        <div style="background: #eae6db;padding: 0.3vh 0 2vh 0;margin-top: 1vh;">
            <div id="player1" class="aplayer" style="margin: 4vw auto 0;width:86.3vw;background: #fff;"></div>
        </div>
        {/notempty}
        {notempty name="$article.record2"}
        <div style="background: #eae6db;padding: 4vh 0 2vh 0;margin-top: 1vh;">
            <div id="player2" class="aplayer" style="margin: -1.5vh auto 0;width:86.3vw;background: #fff;"></div>
        </div>
        {/notempty}
        {notempty name="$article.record3"}
        <div style="background: #eae6db;padding: 4vh 0 2vh 0;margin-top: 1vh;">
            <div id="player3" class="aplayer" style="margin: -1.5vh auto 0;width:86.3vw;background: #fff;"></div>
        </div>
        {/notempty}
        <div class="info">
            　{$article.content}
        </div>
    </div>
</div>
<a href="{:Url('Word/news')}" class="after manager" id="publish"></a>
{/block}


{block name="script"}
<script src="__HOME__/js/reset.js"></script>
<script src="__HOME__/js/APlayer.min.js"></script>
<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script>
    //关闭分享
    function onBridgeReady() {
        WeixinJSBridge.call('hideOptionMenu');
    }
    if (typeof WeixinJSBridge == "undefined") {
        if (document.addEventListener) {
            document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
        } else if (document.attachEvent) {
            document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
            document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
        }
    } else {
        onBridgeReady();
    }
    $('title').text('点对点教育VIP学员_每日单词');
    $(".info img").on('click',function(event) {
        var imgArray = [];
        var curImageSrc = window.location.protocol+'//'+window.location.host+$(this).attr('src');
        var oParent = $(this).parent();
        if (curImageSrc && !oParent.attr('href')) {
            oParent.parent().find("img").each(function(index, el) {
                var itemSrc = window.location.protocol+'//'+window.location.host+$(this).attr('src');
                imgArray.push(itemSrc);
            });
            wx.previewImage({
                current: curImageSrc,
                urls: imgArray
            });
        }
    });
    $(function(){
        if(document.getElementById("publish")){
            moveanyway("publish");
        }
    })
    if($('#player1').length>0){
        var ap1 = new APlayer({
            element: document.getElementById('player1'),
            narrow: false,
            autoplay: true,
            showlrc: false,
            music: {
                title: '点击收听{$article.record1_name}',
                author: ' ',
                url: '{$article.record1}',
                pic: '/DDDeducation/public/home/images/word/bf.png'
            }
        });
        ap1.init();
    }
    if($('#player2').length>0){
        var ap2 = new APlayer({
            element: document.getElementById('player2'),
            narrow: false,
            autoplay: true,
            showlrc: false,
            music: {
                title: '点击收听{$article.record2_name}',
                author: ' ',
                url: '{$article.record2}',
                pic: '/DDDeducation/public/home/images/word/bf.png'
            }
        });
        ap2.init();
    }
    if($('#player3').length>0){
        var ap3 = new APlayer({
            element: document.getElementById('player3'),
            narrow: false,
            autoplay: true,
            showlrc: false,
            music: {
                title: '点击收听{$article.record3_name}',
                author: ' ',
                url: '{$article.record3}',
                pic: '/DDDeducation/public/home/images/word/bf.png'
            }
        });
        ap3.init();
    }
</script>
<script>
    $('#player1,#player2,#player3').on('click',function(){
        if($(this).find('.aplayer-button').eq(0).hasClass('aplayer-hide')){
            $(this).find('.aplayer-pic>img').attr('src','/DDDeducation/public/home/images/word/bf.png')
        }else {
            $(this).find('.aplayer-pic>img').attr('src','/DDDeducation/public/home/images/word/zt.png')
        }
    })

</script>
{/block}